package com.woniuxy.vouchers.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniuxy.vouchers.mapper.RecordMapper;
import com.woniuxy.vouchers.service.RecordService;
import com.woniuxy.vouchers.vo.RecordVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class RecordServiceImpl implements RecordService {

    @Resource
    private RecordMapper recordMapper;



    @Override
    public PageInfo<RecordVo> findAll(Integer currentPage, Integer pageSize, String name) {
        PageHelper.startPage(currentPage, pageSize);
        List<RecordVo> list = recordMapper.findAll(name);
        PageInfo<RecordVo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

}
